package net.starwifi.duobao.service;

import net.starwifi.duobao.entity.*;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2015/9/28.
 */
public interface OrderService extends BaseService<Order,Long>{



      Order findBySn(String sn);

     Order create(Cart cart, Receiver receiver, PaymentMethod paymentMethod, ShippingMethod shippingMethod, boolean isInvoice, String invoiceTitle, boolean useBalance, String memo);


    /* 充值订单创建 */
      Order build(PaymentMethod paymentMethod,BigDecimal productAmount, String sn,int orderType, Member member);

    /**
     * 生成订单
     *
     * @param cart 购物车
     * @param receiver 收货地址
     * @param paymentMethod 支付方式
     * @param shippingMethod 配送方式
     * @param isInvoice 是否开据发票
     * @param invoiceTitle 发票抬头
     * @param useBalance  是否使用余额
     * @param memo 附言
     * @return 订单
     */
    Order build(Cart cart, Receiver receiver, PaymentMethod paymentMethod, ShippingMethod shippingMethod, boolean isInvoice, String invoiceTitle, boolean useBalance, String memo);


    /**
      * 订单支付
      *
      * @param order 订单
      * @param payment 收款单
      */
     void payment(Order order, Payment payment);


}
